package cn.itcast.bos.service.take_delivery;
/**
 * Created with IntelliJ IDEA.
 *
 * @author: SOS
 * @create: 2018-02-26 14:13
 */

import cn.itcast.bos.domain.page.PageBean;
import cn.itcast.bos.domain.take_delivery.Promotion;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;
import java.util.Date;


/**
 * @program: ideabos2.0
 * @description: 宣传任务的接口
 * @author: SOS
 * @create: 2018-02-26 14:13
 **/

public interface PromotionService {

    void save(Promotion model);

    Page<Promotion> findPageDate(Pageable pageable);

    //提供webservice服务
    @Path("/pageQuery")
    @GET
    @Consumes({"application/xml","application/json"})
    @Produces({"application/xml","application/json"})
    PageBean<Promotion> findPageDate(@QueryParam("page") Integer page,
                                     @QueryParam("rows") Integer rows);

    @Path("/promotion/{id}")
    @GET
    @Consumes({MediaType.APPLICATION_JSON,MediaType.APPLICATION_XML})
    @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON})
    Promotion findById(@PathParam("id") Integer id);

    void updateStatus(Date date);
}
